//
//  BQMyCouponCell.m
//  BeeQuick
//
//  Created by Vivitickey on 2017/5/6.
//  Copyright © 2017年 test. All rights reserved.
//

#import "BQMyCouponCell.h"
#import "UIColor+HMAddition.h"
#import "BQMyCouponModel.h"
@interface BQMyCouponCell ()
@property (weak, nonatomic) IBOutlet UIImageView *bgImageView;
@property (weak, nonatomic) IBOutlet UIImageView *roundImageView;
@property (weak, nonatomic) IBOutlet UILabel *valueLabel;
@property (weak, nonatomic) IBOutlet UILabel *statusLabel;
@property (weak, nonatomic) IBOutlet UILabel *nameLabel;
@property (weak, nonatomic) IBOutlet UILabel *start_timeLabel;
@property (weak, nonatomic) IBOutlet UILabel *end_timeLabel;
@property (weak, nonatomic) IBOutlet UILabel *descriptionLabel;
@property (weak, nonatomic) IBOutlet UIImageView *line1;
@property (weak, nonatomic) IBOutlet UIImageView *line2;
@property (weak, nonatomic) IBOutlet UIImageView *line3;
@property (weak, nonatomic) IBOutlet UILabel *label1;
@property (weak, nonatomic) IBOutlet UILabel *label2;

@end

@implementation BQMyCouponCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

-(void)setModel:(BQMyCouponModel *)model{
    
    _model = model;
    
    if (model.status == 0) {
        
        _line1.backgroundColor = [UIColor hm_colorWithR:227 G:207 B:184];
        
        _line2.backgroundColor = [UIColor hm_colorWithR:227 G:207 B:184];
        
        _line3.backgroundColor = [UIColor hm_colorWithR:227 G:207 B:184];
        
        _label1.textColor = [UIColor hm_colorWithR:155 G:113 B:84];
        
        _label2.textColor = [UIColor hm_colorWithR:155 G:113 B:84];
        
        _nameLabel.textColor = [UIColor hm_colorWithR:148 G:98 B:62];
        
        _start_timeLabel.textColor = [UIColor hm_colorWithR:155 G:113 B:84];
        
        _end_timeLabel.textColor = [UIColor hm_colorWithR:155 G:113 B:84];
        
        _descriptionLabel.textColor = [UIColor hm_colorWithR:155 G:113 B:84];
        
    }else{
        
        _line1.backgroundColor = [UIColor lightGrayColor];
        
        _line2.backgroundColor = [UIColor lightGrayColor];
        
        _line3.backgroundColor = [UIColor lightGrayColor];
        
        _label1.textColor = [UIColor lightGrayColor];
        
        _label2.textColor = [UIColor lightGrayColor];
        
        _nameLabel.textColor = [UIColor lightGrayColor];
        
        _start_timeLabel.textColor = [UIColor lightGrayColor];
        
        _end_timeLabel.textColor = [UIColor lightGrayColor];
        
        _descriptionLabel.textColor = [UIColor lightGrayColor];
        
    }
    

    
    _bgImageView.image = [UIImage imageNamed:model.status == 0 ? @"v2_coupon_yellow" : @"v2_coupon_gray"];
    
    _roundImageView.backgroundColor = model.status == 0 ? [UIColor hm_colorWithR:252 G:211 B:69] :[UIColor hm_colorWithR:210 G:210 B:210];
    
    _valueLabel.text = [NSString stringWithFormat:@"$%d",model.value];
    
    
    if (model.status == 1) {
        _statusLabel.text = @"已使用";
    }else if(model.status == 2){
        _statusLabel.text = @"已过期";
    }else{
        
        _statusLabel.text = @"";
    }
    
    _nameLabel.text = model.name;
    
    _start_timeLabel.text = model.start_time;
    
    _end_timeLabel.text = model.end_time;
    
    _descriptionLabel.text = model._description;
    
    
    
}

@end
